home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / MUI / MCC_TextEditor / Developer / Modula / txt / MCCTextEditor.def
Encoding:
Modula Definition  |  1997-08-31  |  9.2 KB  |  204 lines

  1. DEFINITION MODULE TextEditor; (* 09-Aug-97 st *)
  2.  
  3. (*$ Implementation- *)       (* Cyclone *)
  4. (*  Implementation:=FALSE *) (* M2Amiga *)
  5.  
  6. (*
  7. **
  8. ** $VER: TextEditor_mcc.h V15.1 (12-Aug-97)
  9. ** Copyright © 1997 Allan Odgaard. All rights reserved.
  10. **
  11. ** Modula-2 definition module: 30-Aug-97 Sönke Tesch (st) <soenke@vapor.com>
  12. **
  13. *)
  14.  
  15. FROM SYSTEM IMPORT ADDRESS,BYTE
  16. ;
  17.  
  18. CONST mcTextEditor = "TextEditor.mcc";
  19.  
  20. CONST TextEditorDummy                   = 0AD000000H;
  21.       maTextEditorAreaMarked            = TextEditorDummy + 014H;
  22.       maTextEditorColorMap              = TextEditorDummy + 02FH;
  23.       maTextEditorContents              = TextEditorDummy + 002H;
  24.       maTextEditorCursorX               = TextEditorDummy + 004H;
  25.       maTextEditorCursorY               = TextEditorDummy + 005H;
  26.       maTextEditorDoubleClickHook       = TextEditorDummy + 006H;
  27.       maTextEditorExportHook            = TextEditorDummy + 008H;
  28.       maTextEditorExportWrap            = TextEditorDummy + 009H;
  29.       maTextEditorFixedFont             = TextEditorDummy + 00AH;
  30.       maTextEditorFlow                  = TextEditorDummy + 00BH;
  31.       maTextEditorHasChanged            = TextEditorDummy + 00CH;
  32.       maTextEditorHorizontalScroll      = TextEditorDummy + 02DH;
  33.       maTextEditorImportHook            = TextEditorDummy + 00EH;
  34.       maTextEditorImportWrap            = TextEditorDummy + 010H;
  35.       maTextEditorInsertMode            = TextEditorDummy + 00FH;
  36.       maTextEditorInVirtualGroup        = TextEditorDummy + 01BH;
  37.       maTextEditorKeyBindings           = TextEditorDummy + 011H;
  38.       maTextEditorNumLock               = TextEditorDummy + 018H;
  39.       maTextEditorPen                   = TextEditorDummy + 02EH;
  40.       maTextEditorPopWindowOpen         = TextEditorDummy + 003H; (* Private!!! *)
  41.       maTextEditorPropDeltaFactor       = TextEditorDummy + 00DH;
  42.       maTextEditorPropEntries           = TextEditorDummy + 015H;
  43.       maTextEditorPropFirst             = TextEditorDummy + 020H;
  44.       maTextEditorPropRelease           = TextEditorDummy + 001H; (* Private!!! *)
  45.       maTextEditorPropVisible           = TextEditorDummy + 016H;
  46.       maTextEditorQuiet                 = TextEditorDummy + 017H;
  47.       maTextEditorReadOnly              = TextEditorDummy + 019H;
  48.       maTextEditorRedoAvailable         = TextEditorDummy + 013H;
  49.       maTextEditorSeparator             = TextEditorDummy + 02CH;
  50.       maTextEditorSlider                = TextEditorDummy + 01AH;
  51.       maTextEditorStyleBold             = TextEditorDummy + 01CH;
  52.       maTextEditorStyleItalic           = TextEditorDummy + 01DH;
  53.       maTextEditorStyleUnderline        = TextEditorDummy + 01EH;
  54.       maTextEditorTypeAndSpell          = TextEditorDummy + 007H;
  55.       maTextEditorUndoAvailable         = TextEditorDummy + 012H;
  56.       maTextEditorWrapBorder            = TextEditorDummy + 021H;
  57.       mmTextEditorAddKeyBindings        = TextEditorDummy + 022H;
  58.       mmTextEditorARexxCmd              = TextEditorDummy + 023H;
  59.       mmTextEditorClearText             = TextEditorDummy + 024H;
  60.       mmTextEditorExportText            = TextEditorDummy + 025H;
  61.       mmTextEditorHandleError           = TextEditorDummy + 01FH;
  62.       mmTextEditorInsertText            = TextEditorDummy + 026H;
  63.       mmTextEditorMacroBegin            = TextEditorDummy + 027H;
  64.       mmTextEditorMacroEnd              = TextEditorDummy + 028H;
  65.       mmTextEditorMacroExecute          = TextEditorDummy + 029H;
  66.       mmTextEditorReplace               = TextEditorDummy + 02AH;
  67.       mmTextEditorSearch                = TextEditorDummy + 02BH;
  68.  
  69. TYPE mpTextEditorARexxCmd = RECORD
  70.        methodID : LONGCARD;
  71.        command : ADDRESS; (* actually StringPtr *)
  72.      END;
  73.      mpTextEditorARexxCmdPtr = POINTER TO mpTextEditorARexxCmd;
  74.  
  75.      mpTextEditorClearText = RECORD
  76.        methodID : LONGCARD;
  77.      END;
  78.      mpTextEditorClearTextPtr = POINTER TO mpTextEditorClearText;
  79.  
  80.      mpTextEditorExportText = RECORD
  81.        methodID : LONGCARD;
  82.      END;
  83.      mpTextEditorExportTextPtr = POINTER TO mpTextEditorExportText;
  84.  
  85.      mpTextEditorHandleError = RECORD
  86.        methodID : LONGCARD;
  87.        errorCode : LONGCARD; (* See below for error codes *)
  88.      END;
  89.      mpTextEditorHandleErrorPtr = POINTER TO mpTextEditorHandleError;
  90.  
  91.      mpTextEditorInsertText = RECORD
  92.        methodID : LONGCARD;
  93.        text : ADDRESS; (* actually StringPtr *)
  94.        pos  : LONGCARD;
  95.      END;
  96.      mpTextEditorInsertTextPtr = POINTER TO mpTextEditorInsertText;
  97.  
  98. CONST mvTextEditorExportHookPlain       = 000000000H;
  99.       mvTextEditorExportHookEMail       = 000000001H;
  100.  
  101.       mvTextEditorFlowLeft              = 000000000H;
  102.       mvTextEditorFlowCenter            = 000000001H;
  103.       mvTextEditorFlowRight             = 000000002H;
  104.       mvTextEditorFlowFull              = 000000003H;
  105.  
  106.       mvTextEditorImportHookPlain       = 000000000H;
  107.       mvTextEditorImportHookEMail       = 000000002H;
  108.       mvTextEditorImportHookMIME        = 000000003H;
  109.       mvTextEditorImportHookMIMEQuoted  = 000000004H;
  110.  
  111.       mvTextEditorLengthHookPlain       = 000000000H;
  112.       mvTextEditorLengthHookANSI        = 000000001H;
  113.       mvTextEditorLengthHookHTML        = 000000002H;
  114.       mvTextEditorLengthHookMAIL        = 000000003H;
  115.  
  116.       mvTextEditorInsertTextCursor      = 000000000H;
  117.       mvTextEditorInsertTextTop         = 000000001H;
  118.       mvTextEditorInsertTextBottom      = 000000002H;
  119.  
  120. (* Error codes given as argument to mmTextEditorHandleError *)
  121. CONST ErrorClipboardIsEmpty         = 001H;
  122.       ErrorClipboardIsNotFTXT       = 002H;
  123.       ErrorMacroBufferIsFull        = 003H;
  124.       ErrorMemoryAllocationFailed   = 004H;
  125.       ErrorNoAreaMarked             = 005H;
  126.       ErrorNoMacroDefined           = 006H;
  127.       ErrorNothingToRedo            = 007H;
  128.       ErrorNothingToUndo            = 008H;
  129.       ErrorNotEnoughUndoMem         = 009H; (* This will cause all the stored undos to be freed *)
  130.       ErrorStringNotFound           = 00AH;
  131.  
  132. TYPE ClickMessage = RECORD
  133.        lineContents  : ADDRESS;  (* actually StringPtr, this field is ReadOnly!!! *)
  134.        clickPosition : LONGCARD;
  135.      END;
  136.      ClickMessagePtr = POINTER TO ClickMessage;
  137.  
  138.   (* Definitions for Separator type *)
  139. TYPE SeparatorFlags =
  140.       (
  141.        lnsTop,        (*    Mutual exclude: *)
  142.        lnsMiddle,     (*    Placement of    *)
  143.        lnsBottom,     (*     the separator  *)
  144.        lnsStrikeThru, (*    Let separator go thru the textfont *)
  145.        lnsThick,      (*    Extra thick separator *)
  146.        lns5,lns6,lns7,lns8,lns9,lns10,lns11,lns12,lns13,lns14,lns15
  147.       );
  148.      SeparatorFlagSet = SET OF SeparatorFlags;
  149.  
  150. CONST SeparatorTop    = SeparatorFlagSet{lnsTop};    (* maybe you should use these *)
  151.       SeparatorMiddle = SeparatorFlagSet{lnsMiddle}; (* instead of the flags above *)
  152.       SeparatorBottom = SeparatorFlagSet{lnsBottom};
  153.  
  154. TYPE LineColor = RECORD
  155.        xPos,color : CARDINAL;
  156.      END;
  157.  
  158. TYPE LineStyleFlags = (bold,underline,italic,sf3,sf4,sf5,sf6,sf7,sf8,sf9,sf10,sf11,sf12,sf13,sf14,sf15);
  159.      LineStyleFlagSet = SET OF LineStyleFlags;
  160.  
  161.      LineStyle = RECORD
  162.        xPos : CARDINAL;
  163.        style : LineStyleFlagSet;
  164.      END;
  165.  
  166. TYPE LineNode = RECORD
  167.        contents  : ADDRESS;    (*  actually StringPtr, set this to the linecontents (allocated via the poolhandle) *)
  168.        length    : LONGCARD;   (*  The length of the line (including the '\n') *)
  169.        styles    : POINTER TO ARRAY [0..511] OF LineStyle; (* Set this to the styles used for this line (allocated via the poolhandle) *)
  170.        colors    : POINTER TO ARRAY [0..511] OF LineColor;
  171.        colorPad  : BYTE;
  172.        color     : BOOLEAN;    (*  Set this to TRUE if you want the line to be highlighted *)
  173.        flow      : CARDINAL;   (*  Use the mvTextEditorFlow#? values... *)
  174.        separator : SeparatorFlagSet;
  175.      END;
  176.      LineNodePtr = POINTER TO LineNode;
  177.  
  178. TYPE ExportMessage = RECORD
  179.        userData   : ADDRESS;    (*  This is set to what your hook returns (NULL the first time) *)
  180.        contents   : ADDRESS;    (*  actually StringPtr, pointer to the current line *)
  181.        length     : LONGCARD;   (*  Length of Contents, including the '\n' character *)
  182.        styles     : POINTER TO ARRAY [0..511] OF LineStyle;
  183.        colors     : POINTER TO ARRAY [0..511] OF LineColor;
  184.        highlightPad : BYTE;
  185.        highlight  : BOOLEAN;
  186.        flow       : CARDINAL;   (*  Current lines flow *)
  187.        separator  : SeparatorFlagSet;   (*  Se definitions above *)
  188.        exportWrap : LONGCARD;   (*  For your use only (reflects maTextEditorExportWrap) *)
  189.        lastPad    : BYTE;
  190.        last       : BOOLEAN;    (*  Set to TRUE if this is the last line *)
  191.        data       : ADDRESS;    (*  Private! *)
  192.      END;
  193.      ExportMessagePtr = POINTER TO ExportMessage;
  194.  
  195. TYPE ImportMessage = RECORD
  196.        data       : ADDRESS;     (*  actually StringPtr, the first time the hook is called, then this will be either the value of maTextEditorContents, or the argument given to mmTextEditorInsert. *)
  197.        lineNode   : LineNodePtr; (*  Pointer to a linenode, which you should fill out *)
  198.        poolHandle : ADDRESS;     (*  A poolhandle, all allocations done for styles or contents must be made from this pool, and the size of the allocation must be stored in the first LONG *)
  199.        importWrap : LONGCARD;    (*  For your use only (reflects maTextEditorImportWrap) *)
  200.      END;
  201.      ImportMessagePtr = POINTER TO ImportMessage;
  202.  
  203. END TextEditor.def
  204.